//
//  AddgroupController.m
//  LiquorChain
//
//  Created by apple on 2018/12/27.
//  Copyright © 2018年 王冬. All rights reserved.
//

#import "AddgroupController.h"

@interface AddgroupController ()

@end

@implementation AddgroupController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"加群码";
    UIView *backView =[[UIView alloc]initWithFrame:CGRectMake(0, kNavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-kNavBarHeight-kIPhoneXBottomHeight)];
    backView.backgroundColor = CUSTOMCOLOR;
    [self.view addSubview:backView];
    
    UILabel *headLabel =[[UILabel alloc]init];
    [backView addSubview:headLabel];
    headLabel.text = @"您的专属客服微信群";
    headLabel.textColor = [UIColor whiteColor];
    headLabel.textAlignment = NSTextAlignmentCenter;
    headLabel.font = [UIFont systemFontOfSize:25];
    [headLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(32);
        make.left.mas_equalTo(76);
        make.right.mas_equalTo(-76);
        make.height.mas_equalTo(24);
    }];
    
    UILabel *topLabel =[[UILabel alloc]init];
    [backView addSubview:topLabel];
    topLabel.textAlignment = NSTextAlignmentCenter;
    topLabel.textColor = [UIColor whiteColor];
    topLabel.text = @"保存图片或者截图";
    topLabel.font =[UIFont systemFontOfSize:12];
    [topLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(headLabel.mas_bottom).with.offset(14);
        make.left.mas_equalTo(headLabel.mas_left).with.offset(23);
        make.right.mas_equalTo(headLabel.mas_right).with.offset(-23);
        make.height.mas_equalTo(16);
    }];
    
    UILabel *topLabel1 =[[UILabel alloc]init];
    [backView addSubview:topLabel1];
    topLabel1.textAlignment = NSTextAlignmentCenter;
    topLabel1.textColor = [UIColor whiteColor];
    topLabel1.text = @"用微信扫描二维码加入专属客服群";
    topLabel1.font =[UIFont systemFontOfSize:12];
    [topLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(topLabel.mas_bottom).with.offset(0);
        make.left.mas_equalTo(topLabel.mas_left).with.offset(0);
        make.right.mas_equalTo(topLabel.mas_right).with.offset(0);
        make.height.mas_equalTo(16);
    }];
    
    UIView *bodyView =[[UIView alloc]init];
    [backView addSubview:bodyView];
    bodyView.backgroundColor =[UIColor whiteColor];
    bodyView.layer.cornerRadius = 5;
    [bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(topLabel1.mas_bottom).with.offset(34);
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(407);
    }];
    UILabel *timeLabel =[[UILabel alloc]init];
    [bodyView addSubview:timeLabel];
    timeLabel.text = @"加群时间:9:00-23:00";
    timeLabel.textAlignment = NSTextAlignmentCenter;
    timeLabel.font = [UIFont systemFontOfSize:12];
    timeLabel.textColor =RGBA(249, 150, 186, 1);
    [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(27);
        make.left.mas_equalTo(111);
        make.right.mas_equalTo(-111);
        make.height.mas_equalTo(12);
    }];
    UIImageView *qcodeImageView =[[UIImageView alloc]init];
    [bodyView addSubview:qcodeImageView];
    qcodeImageView.image =[UIImage imageNamed:@"qcode"];
    [qcodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(timeLabel.mas_bottom).with.offset(5);
        make.centerX.mas_equalTo(bodyView.mas_centerX);
        make.width.mas_equalTo(188);
        make.height.mas_equalTo(188);
        
    }];
    
    UIButton *commitBtn =[UIButton buttonWithType:UIButtonTypeCustom];
    [bodyView addSubview:commitBtn];
    commitBtn.backgroundColor = CUSTOMCOLOR;
    commitBtn.layer.cornerRadius = 20;
    [commitBtn setTitle:@"保存图片" forState:UIControlStateNormal];
    [commitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [commitBtn addTarget:self action:@selector(commitClick:) forControlEvents:UIControlEventTouchUpInside];
    [commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(qcodeImageView.mas_bottom).with.offset(20);
        make.left.mas_equalTo(qcodeImageView.mas_left).with.offset(-56);
        make.right.mas_equalTo(qcodeImageView.mas_right).with.offset(56);
        make.height.mas_equalTo(40);
    }];
    
    UIImageView *leftView =[[UIImageView alloc]init];
    [bodyView addSubview:leftView];
    leftView.backgroundColor = [UIColor greenColor];
    [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(24);
        make.left.mas_equalTo(49);
        make.height.mas_equalTo(27);
        make.width.mas_equalTo(34);
    }];
    UILabel *leftLabel =[[UILabel alloc]init];
    [bodyView addSubview:leftLabel];
    leftLabel.text = @"微信打开扫一扫";
    leftLabel.numberOfLines = 0;
    leftLabel.textColor = RGBA(136.0, 136.0, 136.0, 1);
    leftLabel.textAlignment = NSTextAlignmentCenter;
    leftLabel.font =[UIFont systemFontOfSize:12];
    [leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(43);
        make.top.mas_equalTo(leftView.mas_bottom).with.offset(9);
        make.width.mas_equalTo(50);
        //make.height.mas_equalTo(27);
    }];
    
    UILabel *leftLineLabel =[[UILabel alloc]init];
    [bodyView addSubview:leftLineLabel];
    leftLineLabel.text = @"------";
    leftLineLabel.font =[UIFont systemFontOfSize:9];
    leftLineLabel.textAlignment = NSTextAlignmentCenter;
    leftLineLabel.textColor = [UIColor blackColor];
    [leftLineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(57);
        make.left.mas_equalTo(leftLabel.mas_right).with.offset(11);
        make.width.mas_equalTo(29);
        make.height.mas_equalTo(3);
    }];
    
    

    
    UIImageView *centerView =[[UIImageView alloc]init];
    [bodyView addSubview:centerView];
    centerView.backgroundColor = [UIColor redColor];
    [centerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(24);
        make.centerX.mas_equalTo(bodyView.mas_centerX);
        make.height.width.mas_equalTo(29);
        
    }];
    
    UILabel *centerLabel =[[UILabel alloc]init];
    [bodyView addSubview:centerLabel];
    centerLabel.text = @"扫描相册中保存的图片";
    centerLabel.numberOfLines = 0;
    centerLabel.textColor = RGBA(136.0, 136.0, 136.0, 1);
    centerLabel.font =[UIFont systemFontOfSize:12];
    centerLabel.textAlignment = NSTextAlignmentCenter;
    [centerLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(centerView.mas_bottom).with.offset(9);
        make.centerX.mas_equalTo(bodyView.mas_centerX);
        make.width.mas_equalTo(70);
        //make.height.mas_equalTo(27);
    }];
    
    UILabel *rightLineLabel =[[UILabel alloc]init];
    [bodyView addSubview:rightLineLabel];
    rightLineLabel.text = @"------";
    rightLineLabel.font =[UIFont systemFontOfSize:9];
    rightLineLabel.textAlignment = NSTextAlignmentCenter;
    rightLineLabel.textColor = [UIColor blackColor];
    [rightLineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(57);
        make.left.mas_equalTo(centerLabel.mas_right).with.offset(11);
        make.width.mas_equalTo(29);
        make.height.mas_equalTo(3);
    }];
    
    
    UIImageView *rightView =[[UIImageView alloc]init];
    [bodyView addSubview:rightView];
    rightView.backgroundColor = [UIColor yellowColor];
    [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(24);
        make.right.mas_equalTo(-49);
        make.height.width.mas_equalTo(29);
    }];
    
    UILabel *rightLabel =[[UILabel alloc]init];
    [bodyView addSubview:rightLabel];
    rightLabel.text = @"同意加群成功";
    rightLabel.numberOfLines = 0;
    rightLabel.textColor = RGBA(136.0, 136.0, 136.0, 1);
    rightLabel.font =[UIFont systemFontOfSize:12];
    rightLabel.textAlignment = NSTextAlignmentCenter;
    [rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(rightView.mas_bottom).with.offset(9);
        make.right.mas_equalTo(-44);
        make.width.mas_equalTo(50);
        //make.height.mas_equalTo(27);
    }];
    
    
    // Do any additional setup after loading the view.
}
-(void)commitClick:(UIButton *)sender{
    NSLog(@"test");
}
    
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
